<!--
jQuery(document).ready(function(){
	/* check all */
	if (jQuery('#check_header')) {
		jQuery('#check_header').click(function () {
			if (this.checked == false) {
				jQuery('.check_value:checked').attr('checked', false);
			}
			else {
				jQuery('.check_value:not(:checked)').attr('checked', true);
			}
		});
	}

	/* For validate form show Calendar */
	jQuery("#startdate").datepicker({
		altField: '#start_alternate',
		altFormat: 'yy-mm-dd',
		minDate: '-1y'
	});
	jQuery("#enddate").datepicker({
		altField: '#end_alternate',
		altFormat: 'yy-mm-dd',
		minDate: '-1y'
	});
	jQuery("#woring_on").datepicker({
		altField: '#working_alternate',
		altFormat: 'yy-mm-dd',
		minDate: '-1y'
	});
	jQuery("#workingon").datepicker({
		altField: '#working_on_alternate',
		altFormat: 'yy-mm-dd',
		minDate: '-1y'
	});
	jQuery("#catch_on").datepicker({
		altField: '#catchup_on_alternate',
		altFormat: 'yy-mm-dd',
		minDate: '-1y'
	});
//	jQuery("#catch_on").datepicker({
//		altField: '#catch_on_alternate',
//		altFormat: 'yy-mm-dd',
//		minDate: '-1y'});
	
	/* Search jQeury DataTable */
	jQuery('#search').dataTable()
	.columnFilter({
		aoColumns: [ 
		{
			type: "text"
		},null,
		{
			type: "number"
		},
		{
			type: "select", 
			values: [ 'A', 'C', 'U', 'X']
		}
		]

	});
});
/* Show record per page */
function limitRecordPerPage(obj){
	window.location = "?limit=" + obj.value;
}
/* show check annual or catchup type leave */
function check(elem) {
	document.getElementById('catchup').disabled = !elem.selectedIndex;
	document.getElementById('annual').disabled = elem.selectedIndex;
	document.getElementById('annual1').disabled = elem.selectedIndex;
	document.getElementById('workingon').disabled = !elem.selectedIndex;
	document.getElementById('catch_on').disabled = !elem.selectedIndex;
	document.getElementById('catchupon').disabled = !elem.selectedIndex;

}

/* Show sub department*/
function getValue(elem) {
	if (elem.selectedIndex == 6) {
		document.getElementById('mysub_id').disabled = !elem.selectedIndex;
		document.getElementById('dept_id').disabled = !elem.selectedIndex;
	} else {
		document.getElementById('mysub_id').disabled = elem.selectedIndex;
	}
}

//-->
